package com.orion.service.fallback;

import com.orion.entity.Result;
import com.orion.enumeration.CommonCodeEnum;
import com.orion.service.TestFeignHystrixService;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 * @date 2021/10/30
 */
@Component
public class TestFeignHystrixServiceFallback implements TestFeignHystrixService {

    @Override
    public Result providerHystrix() {
        return CommonCodeEnum.COMMON_SERVER_ERROR.toResult();
    }

    @Override
    public Result providerPartHystrix(Integer a) {
        return CommonCodeEnum.COMMON_FAILURE.toResult("hystrix : " + a);
    }

    @Override
    public Result providerPartCircuit(Integer a) {
        return CommonCodeEnum.COMMON_FAILURE.toResult("circuit : " + a);
    }
}
